<?php

namespace JsonLowCode\UI;

/**
 * a 标签 组件
 * @method static Link make(mixed $children = null, string|Icon $icon = null, string $iconPlacement = "left") Link组件
 */
class Link extends Button
{
    /**
     * @param mixed|null $children
     * @param string|Icon|null $icon
     * @param string $iconPlacement
     */
    public function __construct(mixed $children = null, string|Icon $icon = null, string $iconPlacement = "left")
    {
        parent::__construct($children,$icon,$iconPlacement);
        $this->text()->tag("a")->href("JavaScript:void(0);");
    }

    /**
     * href链接跳转
     * @param string $href
     * @return $this
     */
    public function href(string $href = "",bool $isJSExpression = false): static
    {
        return $this->prop("href",$href);
    }

    /**
     * target 跳转方式
     * @param string $target
     * @return $this
     */
    public function target(string $target = "_blank" |"_self" | "_parent" | "_top",bool $isJSExpression = false): static
    {
        return $this->prop("target",$target);
    }

}
